<?php

if(!defined('APP')) die('error');
?>
<!doctype html>


<html>
<head>
    <meta charset="utf-8">
    <title>员工信息列表</title>
    <style>
        .box{margin: 20px;font-size: 22px;font-weight: bold;text-align: center;}
        .title{font-size: 22px;font-weight: bold;text-align: center;}
        .box table{width: 100%;margin-top: 15px;border-collapse: collapse;font-size: 12px;border:1px solid #000000}
        .box table th .box table td{height: 20px;border: 1px solid #B5D6E6;}
        .box table th{background-color:#E8F6FC;font-weight: normal; }
        .box table td{text-align: center;}




    </style>
</head>
<body>
<div class="box">
    <div class="title">员工信息列表</div>
    <form action="./showlist.php" method="get">
        <div>快速查询：<input type="text" name="keyword"/><input type="submit" value="提交" /></div>
    </form><div><a href="./empAdd.php">添加员工</a></div>


        <table>
            <tr><th><a href="./showlist.php?order=e_id&sort=<?php echo $sort;?>">id</a></th><th>姓名</th><th>所属部门</th><th>出生日期</th><th><a href="./showlist.php?order=date_of_entry&sort=<?php echo $sort;?>">入职时间</a></th><th>相关操作</th></tr>
        <?php if(!empty($emp_info)) { ?>
            <?php foreach($emp_info as $row){ ?>
            <tr>
                <td><?php echo $row['e_id'];?></td>
                <td><?php echo $row['e_name'];?></td>
                <td><?php echo $row['e_dept'];?></td>
                <td><?php echo $row['date_of_birth'];?></td>
                <td><?php echo $row['date_of_entry'];?></td>
                <td><a href="<?php echo './empUpdate.php?e_id='.$row['e_id']?>">编辑</a>&nbsp;&nbsp;<a href="./empdel.php?e_id=<?php echo $row['e_id'];?>">删除</a></td>
            </tr>
            <?php } ?>
            <?php }
            else{ ?>
            <tr><td colspan="6">暂无员工数据！</td></tr><?php } ?>
        </table>
        </div>

</body>
</html>